<template>
	<div  style="width: 576px;padding: 30px;box-sizing: border-box;">
		<el-form label-width="100px" >
		  <el-form-item label="社会信用代码">
		    <el-input v-model="companyMessage.creditNo" :disabled='flag'></el-input>
		  </el-form-item>
		  <el-form-item label="单位名称">
		    <el-input v-model="companyMessage.name" :disabled='flag'></el-input>
		  </el-form-item>
		  <el-form-item label="所属行业">
		   <el-input v-model="companyMessage.businessName" :disabled='flag'></el-input>
		  </el-form-item>
		  <el-form-item label="行政区划">
		  	<el-input v-model='companyMessage.regionName' style='width:49%;' :disabled='flag'></el-input>
		  </el-form-item>
		</el-form>
	</div>	
</template>
<script>
	import {mapState,mapActions} from 'vuex'
	import MD5 from 'md5'
	export default {
		computed:{
			...mapState({
				detailMessage:'detailMessage'
			})
		},
		data(){
			return{
				flag:true,
				companyMessage:{}
			}
		},
     methods:{
     	getCompanyMessage(){
	      	let that = this
	      	let timestamp = Date.parse(new Date())
	        this.$ajax({
						url: localStorage.getItem('ApiUrl')+'/enterprise/query.do?queryKey='+this.detailMessage.creditNo,
						method: 'get',
						headers: {
							'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8'
						}
				})
	        .then(function(res){
				let obj = res.data
				console.log(obj)
				if(obj.respCode == '000') {
				  that.companyMessage = obj
				} 
	        })
	        .catch((err)=>{
	        	console.log(err)
	        })
	      },
	  },
	  mounted(){
	  	this.getCompanyMessage()
	  }
  };
</script>
